package com.xiexiaozhou.helper.core.service;

import com.xiexiaozhou.helper.core.domain.Customer;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface CustomerService {

    //顾客注册、顾客登录、顾客列表（分页）、通过顾客id获取顾客信息、修改顾客信息，申请配送资格，审核配送资格

    /**
     * 顾客注册
     *
     * @param customer
     * @return
     */
    public Customer register(Customer customer);

    /**
     * 顾客登录
     *
     * @param username
     * @param password
     * @return
     */
    public Customer login(String username, String password);

    /**
     * 顾客列表（分页）
     *
     * @param pageable
     * @return
     */
    public Page<Customer> list(Pageable pageable);

    /**
     * 获取所有配送员信息
     *
     * @return
     */
    public List<Customer> listAllDistributor();

    /**
     * 通过顾客id获取顾客信息
     *
     * @param customerId
     * @return
     */
    public Customer get(Long customerId);

    /**
     * 修改顾客信息
     *
     * @param customer
     * @return
     */
    public Customer update(Customer customer);

    /**
     * 申请配送资格
     *
     * @param customerId
     * @return
     */
    public Customer applyToDistributor(Long customerId);

    /**
     * 审核配送资格
     *
     * @param customerId
     * @param applyStatus
     * @return
     * @throws Exception
     */
    public Customer confirmToDistributor(Long customerId, Integer applyStatus) throws Exception;
}
